/*
 * Object.cpp
 *
 *  Created on: 2011-03-30
 *      Author: jacek
 */

#include "Object.h"

Object::Object(uint64 Id): id(Id)
{

}

Object::~Object() {

}
void Object::Intialization(){
	ComponentElement it=components.Begin();
	while((*it)!=NULL){
		it->Intialization();
		++it;
	}

}
void Object::Dispose()
{

	ComponentElement it=components.Begin();
	while((*it)!=NULL){
		it->Dispose();
		++it;
	}

}

void Object::Updata(Event event){
	ComponentElement it=components.Begin();
	while((*it)!=NULL){
		it->Updata(event);
		++it;
	}
}

void Object::RegisterComponent(Component* component){
	component->parent=this;
	components.Add(component);

}
void Object::UnregisterComponent(Component* component){
	components.Remove(component);
}
void Object::SendEvent(Event event){
	if(event.destination!=this->id){
		mainParent->SendEvent(event);
	}
}
bool Object::InsideEvent(uint64 type){
	return 1;
}

